<extend name="Public/base"/>
<block name="head">
	 <link href="__MOBILE__/list.css" rel="stylesheet">
	  <link href="__MOBILE__/css/article.css" rel="stylesheet">
</block>
<block name="body">
	 <include file="Public:article_list" />
	 <div class="container">
	 	<div class="row ">
			<div class="col-sm-12 ">
				<button id="next" class="btn" p="2" total-page="{$total_page}">
					点击加载更多
				</button>
			</div>
		</div>
	 
	 </div>
	 
	 
</block>
<block name="script">
	 
	 $(function(){   
		  $('#next').click(function(){
		  	LoadPage();  
		  }); 
	}); 
	function LoadPage(){
		var currentPage = $('#next').attr('p') ? $('#next').attr('p') : 1;
		$.get("{:U('Index/ajaxNews')}",{p:currentPage},function(result){
			if(result.errno==0){
				$('.article .list').append(result.content);
				$('#next').attr('p',result.p);
				if(result.p>=$('#next').attr('total-page')){
					$('#next').html('木有了，亲');
					$('#next').attr('disabled',true);
					$('#next').addClass('disabled');
				}
			}
			
		},'json');	
	}
</block>